<template>
  <div class="left-container">
    <h3>Left 组件 ---{{count}}</h3>
    <button @click="add">+1</button>
    <h2>获得了{{cat}}</h2>
  </div>
</template>

<script>
import bus from "../utils/eventBus";
export default {
  props:{
    cat:String
  },
  data(){
    return{
      count:1
    }
  },
  methods:{
    add(){
      this.count++
      this.$emit('getAdd',this.count)
      bus.$emit('share',this.count)
    }
  }
}
</script>

<style lang="less">
.left-container {
  padding: 0 20px 20px;
  background-color: orange;
  min-height: 250px;
  flex: 1;
}
</style>
